import React from "react";
import useFormInput from "./hooks/useFormInput";

const Form: React.FC = () => {
  const firstNameProps = useFormInput("小徐");
  const lastNameProps = useFormInput("小芳");

  return (
    <>
      <label>
        First name:
        <input {...firstNameProps} />
      </label>
      <label>
        Last name:
        <input {...lastNameProps} />
      </label>
      <p>
        <b>
          早上好，{firstNameProps.value} {lastNameProps.value}！
        </b>
      </p>
    </>
  );
};
export default Form;
